// pages/home/home.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    name:'world',
    age:18,
    students:[
      {id:110,name: 'kobe1',age: 18},
      {id:111,name: 'kobe2',age: 18},
      {id:112,name: 'kobe3',age: 18},
      {id:113,name: 'kobe4',age: 18}
    ],
    counter:0
  },
  handleBtnClick(){
    // 错误做法  界面没有进行双向绑定
    // this.data.counter += 1
    // 可以通过this.setData()来进行设置
    this.setData({
      counter: this.data.counter +1
    })
  },
  handleSubtraction(){
    this.setData({
      counter:this.data.counter -1
    })
  },
  
})